package demo1;

import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Training {
    //半有序排列
    public int semiOrderedPermutation(int[] nums) {
        int ret = 0;
        int frist = 0;
        int end = 0;
        int n = nums.length;
        for (int i = 0; i < n; i++) {
            if(nums[i]==1) frist = i;
            if(nums[i]==n) end = i;
        }
//        if(end>frist){
//            ret = (frist-0)+(n-1-end)-1;
//        }else {
//            ret = (frist-0)+(n-1-end);
//        }
        return end>frist?(frist-0)+(n-1-end)-1:(frist-0)+(n-1-end);
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = 0;
        int v = 0;
        s = scanner.nextInt();
        v = scanner.nextInt();
        int sum = (8+24)*60;
        if(s%v==0){
            sum = sum-10-s/v;
        }else {
            sum = sum-11-s/v;
        }
        int hour = sum/60;
        int min = sum%60;
        if(hour>=24){
            System.out.println(hour-24+":"+min);
        }else {
            System.out.println(hour+":"+min);
        }
    }

    public static void main1(String[] args) {
        int sum = 1;
        for (int i = 0; i < 22; i++) {
            sum = sum*20%7;
        }
        sum %= 7;
        System.out.println(sum);
    }
}























